import ajax from "../service/ajax.js";

export default{
    namespaced: true,
    state:{
        blightList:{},
        diseaseList:{},
        rodentList:{}
    },
    mutations:{
        setBlightList(state,blight){
            state.blightList = blight
        },
        setBlightParam(state,blight){
            state.blightParam = blight
        },
        setDiseaseList(state,disease){
            state.diseaseList = disease
        },
        setRodentList(state,rodent){
            state.rodentList = rodent
        }
    },
    actions:{
        async findByItem(context){
            let blightInfo = await ajax.getSubmit("/api/blight/findByItem",context.state.blightParam);
            context.commit("setBlightList",blightInfo)
        }
    }
}